﻿<%@ Page Title="Topics" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Topics_Default" %>
<%@ Register TagPrefix="uc" TagName="Menu" Src="~/Topics/Menu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phActions" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phSubMenu" Runat="Server">
    <%--<uc:Menu ID="menu" runat="server" />--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">
    <div class="DirectionText">
        <p>Topics are used to organise posts. Topic Groups are created by developers and used in templates.</p>
    </div>

    <telerik:RadAjaxManager ID="ajaxManager" EnableHistory="true" DefaultLoadingPanelID="loading" runat="server">
    </telerik:RadAjaxManager>
    <acms:AcmsDataList ID="dlGroups" DataSourceID="dsGroups" UseAjax="false" 
        onitemcreated="dlGroups_ItemCreated" OnItemDataBound="dlGroups_ItemDataBound" DataKeyFields="Id,ConcurencyId" 
        runat="server">
        <ItemStyle CssClass="itemPanel" />
        <ItemTemplate>
            <div class="actionButtons clearfix">
                <div class="floatRight">
                    <acms:ActionButton ID="btnAdd" Icon="Add" Text='<%#Eval("Name", "Add New \"{0}\" Topic") %>' OnClick="btnAdd_Click" runat="server" />
                    <acms:ActionButton ID="btnViewAll" NavigateUrl='<%#Eval("Id", "TopicGroup.aspx?GroupId={0}")%>' Text='<%#Eval("Name", "View All \"{0}\" Topics") %>' Icon="Ready" runat="server" />
                    <%--<acms:ActionButton ID="btnViewFiles" NavigateUrl='<%#Eval("Id", "TopicGroup.aspx?GroupId={0}")%>' Text='<%#Eval("Name", "View \"{0}\" Topic Files") %>' Icon="Ready" runat="server" />--%>
                </div>
                <acms:InfoPopUp ID="info" Text='<%#Eval("Notes")%>' CssClass="infoPopUp" runat="server" />
                <%#Eval("Name") %>
            </div>
            <telerik:RadGrid ID="itemGrid" SkinId="InlineEdit" AllowPaging="true" OnItemDataBound="itemGrid_ItemDataBound" PageSize="5" OnNeedDataSource="itemGrid_NeedDataSource" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" OnItemCommand="itemGrid_ItemCommand" OnDeleteCommand="itemGrid_DeleteCommand" OnUpdateCommand="itemGrid_UpdateCommand" OnInsertCommand="itemGrid_InsertCommand" runat="server">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <MasterTableView DataKeyNames="Id,ConcurencyId" AutoGenerateColumns="false" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowAutomaticDeletes="false" InsertItemPageIndexAction="ShowItemOnLastPage" InsertItemDisplay="Bottom" ShowHeadersWhenNoRecords="true">
                    <Columns>
                        <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" />
                        <telerik:GridBoundColumn DataField="Created" HeaderText="Created" ReadOnly="true" />
                        <acms:RadGridSequenceColumn HeaderText="Sequence" SortExpression="Sequence" SequenceField="Sequence" ShowSequence="false" />
                        <%--<acms:RadGridHyperLinkColumn DataTextField="FileCount" DataNavigateUrlFormatString="TopicFiles.aspx?Id={0}&GroupId={1}" DataNavigateUrlFields="Id, TopicGroupId" HeaderText="Files" SortExpression="FileCount"/>--%>
                        <acms:RadGridHyperLinkColumn Text="View Posts" DataNavigateUrlFormatString="TopicPosts.aspx?Id={0}&GroupId={1}" DataNavigateUrlFields="Id, TopicGroupId" HeaderText="Posts"/>
                        <acms:RadGridEditColumn />
                        <acms:RadGridDeleteColumn />
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
            <telerik:RadAjaxLoadingPanel ID="loading" InitialDelayTime="0" MinDisplayTime="2" Transparency="50" BackColor="DimGray" runat="server" Height="100%"
                Width="100%">
                <img alt="Loading..." src="../icons/loading1.gif" style="border: 0px;" />
            </telerik:RadAjaxLoadingPanel>
        </ItemTemplate>
        <SeperatorTemplate>
            <br />
        </SeperatorTemplate>
        <NoDataTemplate>
            Your site is not using topics at the moment. Topic groups are set up by the developer and used in templates. Currrently, no topic groups have been set up. 
        </NoDataTemplate>
    </acms:AcmsDataList>
    <telerik:RadWindowManager ID="winManger" runat="server" />
    <acms:TopicGroupDataSource Id="dsGroups" runat="server" 
        onselectdata="dsGroups_SelectData"/>
    <acms:TopicDataSource ID="dsTopics" runat="server" 
        onselectdata="dsTopics_SelectData">
    </acms:TopicDataSource>
</asp:Content>

